﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Langben.DAL.Complaint>" %>

<%@ Import Namespace="Common" %>
<%@ Import Namespace="Models" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>投诉</title>
    <style type="text/css">
        <!--
        body {
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
        }

        .text {
            font-family: "宋体";
            font-size: 36px;
            line-height: 60px;
            text-align: center;
            background-color: #EA500A;
        }

        .text2 {
            font-family: "宋体";
            font-size: 36px;
            line-height: 60px;
            text-align: center;
            background-color: #ec8327;
            width: 400px;
            height: 80px;
        }

        .text3 {
            font-family: "宋体";
            font-size: 36px;
            line-height: 60px;
            text-align: center;
            background-color: #f9d670;
        }

        .text4 {
            font-family: "宋体";
            font-size: 36px;
            line-height: 65px;
            text-align: center;
            color: #a23808;
        }

        .text5 {
            font-family: "宋体";
            font-size: 27px;
            line-height: 30px;
            text-align: center;
            color: #a23808;
        }

        .td2 {
            border: 2px solid #f05630;
            background-color: white;
        }



        -->
    </style>
    <script src="../../Scripts/jquery.min.js"></script>
    <script type="text/javascript" src="../../Scripts/SoftKey/vk_loader.js?vk_layout=CN%20Chinese%20Simpl.%20Pinyin&vk_skin=flat_gray"></script>
    <script src="../../Scripts/Timer/Timer.js"></script>
    <script>
        function ajaxFrom(form, url) {

            $.ajax({
                url: url,
                type: "Post",
                data: $(form).serialize(),
                dataType: "json",
                success: function (data) {
                    alert(data);
                    window.location.href = "../Map/Index";
                }
            });

        }

        $(function () {

            $("form").submit(function (form) {
                $('#OfficeSpace').val($('#workspace').val());

                $('#Person').val($('#person').val());


                ajaxFrom(this, this.action);


                return false;
            });
            //按钮样式

            $("input[type='text']").css('width', '99%');
            $("input[type='text']").css('height', '97%');


            $('#Floor').change(function () {

                $.ajax({
                    url: "../../Complaint/GetOfficePlace",
                    type: "Post",

                    data: { "floor": $('#Floor').val() },
                    dataType: "json",
                    success: function (data) {

                        $('#workspace').html("<option>请选择</option>");
                        $.each(data, function (i, item) {

                            $('#workspace').append("<option value='" + this.RowGuid + "'>" + this.Name + "</option>");


                        });

                        $('#workspace').css("display", "block");
                        $('#person').css("display", "none");

                    }
                });
            });

            $('#workspace').change(function () {

                $.ajax({
                    url: "../../Complaint/GetPerson",
                    type: "Post",

                    data: { "workspace": $('#workspace').val() },
                    dataType: "json",
                    success: function (data) {

                        $('#person').html("<option>请选择</option>");
                        $.each(data, function (i, item) {

                            $('#person').append("<option value='" + this.Id + "'>" + this.MyName + "</option>");


                        });

                        $('#person').css("display", "block");


                    }
                });
            });


            $('#Describe').focus(function (e) {
                var x = $('#Describe').offset().left;
                var y = $('#Describe').offset().top;
                $("#softkey").css({ "left": x - 100 + "px", "top": y - 200 + "px", "visibility": "visible" });
                VirtualKeyboard.toggle('Describe', 'softkey');
                $("#kb_langselector,#kb_mappingselector,#copyrights").css("display", "none");
            });
            $('#ComplainantName').focus(function (e) {
                var x = $('#ComplainantName').offset().left;
                var y = $('#ComplainantName').offset().top;
                $("#softkey").css({ "left": x - 100 + "px", "top": y - 200 + "px", "visibility": "visible" });
                VirtualKeyboard.toggle('ComplainantName', 'softkey');
                $("#kb_langselector,#kb_mappingselector,#copyrights").css("display", "none");
            });
            $('#ComplainantTel').focus(function (e) {
                var x = $('#ComplainantTel').offset().left;
                var y = $('#ComplainantTel').offset().top;
                $("#softkey").css({ "left": x - 100 + "px", "top": y - 200 + "px", "visibility": "visible" });
                VirtualKeyboard.toggle('ComplainantTel', 'softkey');
                $("#kb_langselector,#kb_mappingselector,#copyrights").css("display", "none");
            });

            $('#Describe').blur(function () {
                VirtualKeyboard.toggle('Describe', 'softkey');
            });
            $('#ComplainantName').blur(function () {
                VirtualKeyboard.toggle('ComplainantName', 'softkey');
            });
            $('#ComplainantTel').blur(function () {
                VirtualKeyboard.toggle('ComplainantTel', 'softkey');
            });

            CMPTimer();


            $('select').css("height", "40px");
            $('select').css("font-size", "30px");

            $('#Floor').css("height", "40px");
            $('#Floor').css("font-size", "30px");

            $('input').css("font-size", "30px");
             
        });

    </script>
</head>

<body>
    <% using (Html.BeginForm())
       { %>
    <div style="display: none">
        <%: Html.EditorFor(model => model.OfficeSpace) %>
        <%: Html.ValidationMessageFor(model => model.OfficeSpace) %>
    </div>
    <div style="display: none">
        <%: Html.EditorFor(model => model.Person) %>
        <%: Html.ValidationMessageFor(model => model.Person) %>
    </div>
    <div style="width: 1920px; height: 1080px; margin: auto; background: url(../../images/Complaint.JPG) no-repeat">
        <div style="width: 1459px; height: 588px; padding-left: 230px; padding-top: 350px;">
            <table width="1459" border="0" cellspacing="5" cellpadding="0">
                <tr>
                    <td class="text2">楼层
                    </td>
                    <td class="td2">
                        <%=Html.DropDownListFor(model => model.Floor,Models.SysFieldModels.GetSysField("OfficeSpace","Floor"),"请选择" )%>
                    </td>
                </tr>
                <tr>
                    <td class="text2">服务地点
                    </td>
                    <td class="td2" id="officeplace" style="font-size: 30px">
                        <table>
                            <tr>
                                <td>
                                    <select id="workspace" style="display: none">
                                        
                                    </select>
                                </td>
                                <td>
                                    <select id="person" style="display: none">
                                         
                                    </select>
                                </td>
                            </tr>
                        </table>



                    </td>
                </tr>
                <tr>
                    <td class="text2">投诉类别
                    </td>
                    <td class="td2">
                       <%=Html.DropDownListFor(model => model.Type,Models.SysFieldModels.GetSysField("Complaint","Type"),"请选择" )%>
                    </td>
                </tr>
                <tr>
                    <td class="text2">投诉描述
                    </td>
                    <td class="td2">
                        <%: Html.EditorFor(model => model.Describe) %>
                        <%: Html.ValidationMessageFor(model => model.Describe) %>
                    </td>
                </tr>
                <tr>
                    <td class="text2">投诉人姓名
                    </td>
                    <td class="td2">
                        <%: Html.EditorFor(model => model.ComplainantName) %>
                        <%: Html.ValidationMessageFor(model => model.ComplainantName) %>
                    </td>
                </tr>
                <tr>
                    <td class="text2">投诉人联系方式（手机）
                    </td>
                    <td class="td2">
                        <%: Html.EditorFor(model => model.ComplainantTel) %>
                        <%: Html.ValidationMessageFor(model => model.ComplainantTel) %>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" style="text-align: center">

                        <input type="image" src="../../Images/Submit.gif" id="imgsubmit" />

                    </td>
                </tr>

            </table>
        </div>
    </div>

    <div id="softkey" style='visibility: hidden; z-index: 10000; position: absolute; left: 0; top: 0'>
    </div>

    <% } %>

     <input type="image" src="../../Images/back.jpg" style="position: absolute; top: 902px;left:1742px" onclick="javascript: window.history.go(-1)"/>
</body>
</html>
